package com.mall.book.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.book.entity.po.CartItem;
import com.mall.book.mappers.CartItemMapper;
import com.mall.book.service.CartItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

/**
 * Created by Dizziness on 2022/3/22 20:10
 */
@Service
public class CartItemServiceImpl implements CartItemService {
    @Autowired
    CartItemMapper cartItemMapper;

    @Override
    public boolean save(CartItem entity) {
        int insert = cartItemMapper.insert(entity);
        return insert > 0;
    }

    @Override
    public boolean saveBatch(Collection<CartItem> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<CartItem> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<CartItem> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(CartItem entity) {
        return false;
    }

    @Override
    public CartItem getOne(Wrapper<CartItem> queryWrapper, boolean throwEx) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper<CartItem> queryWrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<CartItem> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }

    @Override
    public BaseMapper<CartItem> getBaseMapper() {
        return cartItemMapper;
    }

    @Override
    public Class<CartItem> getEntityClass() {
        return CartItem.class;
    }


    @Override
    public List<CartItem> getByMap(HashMap<String, Object> queryMap) {
        return cartItemMapper.selectByMap(queryMap);
    }
}
